﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/**
 * 创建时间：2014/11/26 14:51:24
 * 作者：yong.blackcore
 * Email：itblackhole@outlook.com
 * QQ：50404503
 */
namespace ComicIsland.Common
{
    public class KEYS
    {
        public static string STORE_VERSION = "";

        static KEYS()
        {
            STORE_VERSION = Variables.GetVersion();
        }
        /// <summary>
        /// 请求地址
        /// <para>正式地址：http://mhjk.1391.com</para>
        /// <para>测试地址：http://58.215.139.195</para>
        /// </summary>
        public const string REQUEST_HOST = "http://mhjk.1391.com";// "http://58.215.139.195";

        /// <summary>
        /// WP平台
        /// <para>platformtype=5</para>
        /// </summary>
        public const string REQUEST_QUERY_PLATFORM = "platformtype=5";

        /// <summary>
        /// yyyy-MM-dd
        /// </summary>
        public const string DATE_FORMAT_YMD = "yyyy-MM-dd";

        /// <summary>
        /// SHA加密KEY
        /// </summary>
        public const string KEY_SHA_SECRETKEY = "1234qazwsx";

        public const int PAGE_SIZE = 20;

        /// <summary>
        /// 应用程序信息文件名
        /// </summary>
        public const string WMAPPMANIFEST_NAME = "WMAppManifest.xml";



        /// <summary>
        /// 时间戳
        /// <para>yyyyMMddHHmmss</para>
        /// </summary>
        public const string KEY_DATETIME_FORMAT = "yyyyMMddHHmmss";

        /// <summary>
        /// Storage缓存目录
        /// <para>可删除</para>
        /// </summary>
        public const string ComicIslandCacheDirectory = "comicisland_cache";

        /// <summary>
        /// 图片缓存前缀
        /// <para>image_</para>
        /// </summary>
        public const string CacheImagePrefix = "image_";

        /// <summary>
        /// JSON数据缓存前缀
        /// <para>json_</para>
        /// </summary>
        public const string CacheJsonPrefix = "json_";

        /// <summary>
        /// 热点漫画
        /// </summary>
        public const string KEY_CacheJsonHotComic = "jsonHotComic";

        /// <summary>
        /// 下载数据队列JSON数据缓存前缀
        /// <para>downqueue_</para>
        /// </summary>
        public const string CacheDownloadQueuePrefix = "downqueue_";

        /// <summary>
        /// 添加至下载队列的漫画章节缓存数据
        /// </summary>
        public const string CACHEDOWNLOAD_CHAPTER_QUEUE = "cachedownloadchapterqueue_all";

        /// <summary>
        /// 添加至下载队列的漫画的章节的图片列表缓存数据
        /// <para>cachedownloadchapterimagequeue_{0}_{1}</para>
        /// <para>0:comicId</para>
        /// <para>1:partId</para>
        /// </summary>
        public static string CACHEDOWNLOAD_CHAPTER_IMAGE_QUEUE = "cachedownloadchapterimagequeue_{0}_{1}";

        /// <summary>
        /// 资源文件前缀
        /// <para>CUWo.App</para>
        /// </summary>
        public const string RESOURCE_ASSEMBLYNAME = "/ComicIsland.App;component";

        /// <summary>
        /// Local Database
        /// </summary>
        public const string DBConnectionString = "Data Source=isostore:/comicislanddb.sdf";
        public const string LDBConnectionString = "Data Source=isostore:/comicislandldb.sdf";


        #region 第三方登录
        public const string KEY_UserThirdLoginInfo = "userLogin_third";
        #endregion 第三方登录

        #region 应用ApplicationSettings KEYS
        /// <summary>
        /// 应用欢迎页
        /// <para>使用提示</para>
        /// </summary>
        public const string ASKEY_AppHelpControl = "comicIsland_ASKEY_AppHelpControl";
        #endregion 应用ApplicationSettings KEYS

        /// <summary>
        /// 结果返回结果为200则正确
        /// </summary>
        public const int JSON_SUCCESS = 200;

        /// <summary>
        /// 字符串分割符
        /// </summary>
        public const string SPLITSTRING = "#####";

        public enum SearchType
        {
            /// <summary>
            /// 作者
            /// </summary>
            Author = 0,
            /// <summary>
            /// 书
            /// </summary>
            Book = 1,
            /// <summary>
            /// 搜索书以及book_info中作者字段
            /// </summary>
            Detail = 2
        }

        public enum SearchPageNavigateSearchType
        {
            None = 0,
            Keyword = 10,
            Special = 20,
            Subject = 30
        }

        public enum SearchWantComicFeedType
        {
            /// <summary>
            /// 反馈问题
            /// </summary>
            Question = 1,
            /// <summary>
            /// 求书
            /// </summary>
            Comic = 2
        }

        /// <summary>
        /// ComicList_V2接口的排序方式
        /// </summary>
        public enum ComicListSortType
        {
            /// <summary>
            /// 最热
            /// </summary>
            Hotest = 0,
            /// <summary>
            /// 最新
            /// </summary>
            Newest = 1,
            /// <summary>
            /// 评分
            /// </summary>
            Score = 2,
            /// <summary>
            /// 字母
            /// </summary>
            Character = 3,
            /// <summary>
            /// 位置
            /// </summary>
            Position = 4
        }

        /// <summary>
        /// /comic/wpdataupdate接口的type类型
        /// </summary>
        public enum WpDataUpdateType
        {
            /// <summary>
            /// 数据同步
            /// </summary>
            sync,
            /// <summary>
            /// 收藏夹操作
            /// </summary>
            bookHandle,
            /// <summary>
            /// 更新推送URL
            /// </summary>
            updateChannelurl,
            /// <summary>
            /// 推送开关
            /// </summary>
            updateOptions
        }

        public enum WpDataUpdateTypeSyncBook
        {
            Add,
            Deleted
        }


        public enum PushToastSwitch
        {
            /// <summary>
            /// 关
            /// </summary>
            Close = 0,

            /// <summary>
            /// 开
            /// </summary>
            Open = 1
        }
    }
}
